package com.ruoyi.system.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.RawMaterialMapper;
import com.ruoyi.system.domain.RawMaterial;
import com.ruoyi.system.service.IRawMaterialService;

/**
 * 原材料Service业务层处理
 * 
 * @author liukangzu
 * @date 2025-04-17
 */
@Service
public class RawMaterialServiceImpl implements IRawMaterialService 
{
    @Autowired
    private RawMaterialMapper rawMaterialMapper;

    /**
     * 查询原材料
     * 
     * @param rawMaterialId 原材料主键
     * @return 原材料
     */
    @Override
    public RawMaterial selectRawMaterialByRawMaterialId(Integer rawMaterialId)
    {
        RawMaterial rawMaterial = rawMaterialMapper.selectRawMaterialByRawMaterialId(rawMaterialId);
        System.out.println(rawMaterial);
        return rawMaterial;
    }

    /**
     * 查询原材料列表
     * 
     * @param rawMaterial 原材料
     * @return 原材料
     */
    @Override
    public List<RawMaterial> selectRawMaterialList(RawMaterial rawMaterial)
    {
        List<RawMaterial> rawMaterials = rawMaterialMapper.selectRawMaterialList(rawMaterial);
        System.out.println(rawMaterials);
        return rawMaterials;
    }

    /**
     * 新增原材料
     * 
     * @param rawMaterial 原材料
     * @return 结果
     */
    @Override
    public int insertRawMaterial(RawMaterial rawMaterial)
    {
        return rawMaterialMapper.insertRawMaterial(rawMaterial);
    }

    /**
     * 修改原材料
     * 
     * @param rawMaterial 原材料
     * @return 结果
     */
    @Override
    public int updateRawMaterial(RawMaterial rawMaterial)
    {
        return rawMaterialMapper.updateRawMaterial(rawMaterial);
    }

    /**
     * 批量删除原材料
     * 
     * @param rawMaterialIds 需要删除的原材料主键
     * @return 结果
     */
    @Override
    public int deleteRawMaterialByRawMaterialIds(Integer[] rawMaterialIds)
    {
        return rawMaterialMapper.deleteRawMaterialByRawMaterialIds(rawMaterialIds);
    }

    /**
     * 删除原材料信息
     * 
     * @param rawMaterialId 原材料主键
     * @return 结果
     */
    @Override
    public int deleteRawMaterialByRawMaterialId(Integer rawMaterialId)
    {
        return rawMaterialMapper.deleteRawMaterialByRawMaterialId(rawMaterialId);
    }

    /**
     * 批量处理原材料
     *
     * @param rawMaterialIds 需要删除的原材料主键
     * @return 结果
     */
    @Override
    public int cleanRawMaterialByRawMaterialIds(Integer[] rawMaterialIds)
    {
        return rawMaterialMapper.cleanRawMaterialByRawMaterialIds(rawMaterialIds);
    }

    /**
     * 处理原材料
     *
     * @param rawMaterialId 原材料主键
     * @return 结果
     */
    @Override
    public int cleanRawMaterialByRawMaterialId(Integer rawMaterialId)
    {
        return rawMaterialMapper.cleanRawMaterialByRawMaterialId(rawMaterialId);
    }
}
